<template>
  <div style="margin-top:20px">
    <el-form ref="form" label-width="100px" :model="form">
      <el-row>
        <el-col :span="12">
          <div class="grid-content bg-purple">
            <el-form-item label="供应商编码" prop="supplierCode" style="margin-right:15px">
              <el-input v-model="form.supplierCode" :disabled="true"/>
            </el-form-item>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple">
            <el-form-item label="供应商名称" prop="name" style="margin-right:15px">
              <el-input v-model="form.name" :disabled="true"/>
            </el-form-item>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <div class="grid-content bg-purple">
            <el-form-item label="联系人" prop="contacts" style="margin-right:15px">
              <el-input v-model="form.contacts" :disabled="true"/>
            </el-form-item>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple">
            <el-form-item label="手机号" prop="phone" style="margin-right:15px">
              <el-input v-model="form.phone" :disabled="true"/>
            </el-form-item>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <div class="grid-content bg-purple">
            <el-form-item label="信用代码" prop="businessLicenseImgNumber" style="margin-right:15px">
              <el-input v-model="form.businessLicenseImgNumber" :disabled="true"/>
            </el-form-item>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple">
            <el-form-item label="税点" prop="taxPoint" style="margin-right:15px">
              <el-input v-model="form.taxPoint" :disabled="true"/>
            </el-form-item>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <div class="grid-content bg-purple">
            <el-form-item label="法人姓名" prop="legalPerson" style="margin-right:15px">
              <el-input v-model="form.legalPerson" :disabled="true"/>
            </el-form-item>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple">
            <el-form-item label="身份证号" prop="identificationNumber" style="margin-right:15px">
              <el-input v-model="form.identificationNumber" :disabled="true"/>
            </el-form-item>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div class="grid-content bg-purple">
            <el-form-item label="所在区域" prop="areaList" style="margin-right:15px">
              <el-input v-model="form.area" :disabled="true"/>
            </el-form-item>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div class="grid-content bg-purple">
            <el-form-item label="是否结算" prop="isSettlement" style="margin-right:15px">
              <el-select v-model="form.isSettlement" style="width:100%" disabled>
                <el-option value="0" label="不结算" />
                <el-option value="1" label="结算"/>
              </el-select>
            </el-form-item>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div class="grid-content bg-purple">
            <el-form-item label="地址" prop="address" style="margin-right:15px">
              <el-input v-model="form.address" :disabled="true"/>
            </el-form-item>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div class="grid-content bg-purple">
            <el-form-item label="备注" prop="remark" style="margin-right:15px">
              <el-input v-model="form.remark" :disabled="true"/>
            </el-form-item>
          </div>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>
  import Vue from 'vue'
  import 'xe-utils'
  import VXETable from 'vxe-table'
  import 'vxe-table/lib/index.css'
  import request from '@/utils/request'
  Vue.use(VXETable)
  export default {
    name: 'supplierDetail',
    props: {
      supplyDetail: {
        type: String,
        required: true
      }
    },
    data() {
      return {
        form: {
          supplierCode: '',
          area: '',
          name: '',
          contacts: '',
          phone: '',
          businessLicenseImgNumber: '',
          legalPerson: '',
          identificationNumber: '',
          taxPoint: '',
          country: '',
          isSettlement:'',
          province: '',
          city: '',
          county: '',
          address: '',
          remark: '',
        }
      }
    },
    created() {
      this.getInfo()
    },
    methods: {
      // 获取页面信息
      getInfo() {
        request({url: `/wms/supplier/${this.supplyDetail}`, method: 'get'}).then(response => {
          this.form = response.data
          this.form.isSettlement = this.form.isSettlement.toString()       
        })
      }
    }
  }
</script>
<style lang="scss" scoped>
  .dialog-footer {
    margin-top: 50px;
  }
</style>
